<template>
  <div class="user_manage_frame">
    <el-table
    :data="userData"
      >
      <el-table-column
      prop="userId"
      label="ID"
      >
      </el-table-column>
      <el-table-column
      prop="userName"
      label="用户名"
      >
      </el-table-column>
      <el-table-column
      prop="loginTime"
      label="上次登录时间"
      >
      </el-table-column>

      <el-table-column
      prop="isOnline"
      label="状态"
      >
      <template slot-scope="scope">
        <el-tag :type="scope.row.isOnline?'success':'info'">{{scope.row.isOnline?'在线':'离线'}}</el-tag>
      </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
name:'UserManage',
data(){
  return {
    userData:[]
  }
},
mounted(){
  this.__initData()
},
computed:{
...mapState('userAbout',['token'])
},
methods:{
  __initData(){
  this.$basicAxios(this.$manage.getAllUser(this.token),(resp)=>{
    this.userData = resp.data.data
  })
}
}
}
</script>

<style scoped>
.user_manage_frame{
  width:98%;
  height:100%;
  margin-left: 1%;
  font-weight: bolder;
}
</style>